<template>
  <div class="home">
    <div @click="toSonPage">父项目 {{ emitData }}</div>
    <img alt="Vue logo" src="../assets/logo.png" />
    <div id="nav">
      <router-link to="/collection">collection </router-link> |
      <router-link to="/trace"> trace </router-link> |
      <router-link to="/activity/vueChild"> activity</router-link>
      <router-view />
    </div>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
import { getSpaStore } from 'xu-rabin-event'
export default {
  name: 'Home',
  components: {
    HelloWorld,
  },
  data() {
    return {
      emitData: '测试数据',
    }
  },
  created() {
    console.log('----------')
  },
  methods: {
    open(dialogName, title) {
      this.title = title
    },
    toSonPage() {
      setTimeout(() => {
        getSpaStore().emit('PARENT_PATH', '父项目发来的消息 spa store')
      }, 2000)
      this.$router.push('/activity/vueChild')
    },
  },
}
</script>
